<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.14.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>DM-CtrlH7-BF-DevProgram: C:/Users/ASUS/Desktop/dm-ctrlH7-balance-9025test/Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_spi.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectlogo"><img alt="Logo" src="50x5.png"/></td>
  <td id="projectalign">
   <div id="projectname">DM-CtrlH7-BF-DevProgram<span id="projectnumber">&#160;beta 0.1</span>
   </div>
   <div id="projectbrief">C.ONE Studio Damiao Development Board Framework</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.14.0 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search/",'.html');
</script>
<script type="text/javascript">
$(function() { codefold.init(); });
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search',true);
  $(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(function(){initNavTree('stm32h7xx__hal__spi_8c.html','',''); });
</script>
<div id="container">
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div class="header">
  <div class="headertitle"><div class="title">stm32h7xx_hal_spi.c File Reference</div></div>
</div><!--header-->
<div class="contents">

<p>SPI HAL module driver. This file provides firmware functions to manage the following functionalities of the Serial Peripheral Interface (SPI) peripheral:  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &quot;<a class="el" href="stm32h7xx__hal_8h_source.html">stm32h7xx_hal.h</a>&quot;</code><br />
</div><a name="details" id="details"></a><h2 id="header-details" class="groupheader">Detailed Description</h2>
<div class="textblock"><p>SPI HAL module driver. This file provides firmware functions to manage the following functionalities of the Serial Peripheral Interface (SPI) peripheral: </p>
<dl class="section author"><dt>Author</dt><dd>MCD Application Team<ul>
<li>Initialization and de-initialization functions</li>
<li>IO operation functions</li>
<li>Peripheral Control functions</li>
<li>Peripheral State functions</li>
</ul>
</dd></dl>
<dl class="section attention"><dt>Attention</dt><dd></dd></dl>
<p>Copyright (c) 2017 STMicroelectronics. All rights reserved.</p>
<p>This software is licensed under terms that can be found in the LICENSE file in the root directory of this software component. If no LICENSE file comes with this software, it is provided AS-IS.</p>
<pre class="fragment">==============================================================================
                      ##### How to use this driver #####
==============================================================================
  [..]
    The SPI HAL driver can be used as follows:

    (#) Declare a SPI_HandleTypeDef handle structure, for example:
        SPI_HandleTypeDef  hspi;

    (#)Initialize the SPI low level resources by implementing the HAL_SPI_MspInit() API:
        (##) Enable the SPIx interface clock
        (##) SPI pins configuration
            (+++) Enable the clock for the SPI GPIOs
            (+++) Configure these SPI pins as alternate function push-pull
        (##) NVIC configuration if you need to use interrupt process or DMA process
            (+++) Configure the SPIx interrupt priority
            (+++) Enable the NVIC SPI IRQ handle
        (##) DMA Configuration if you need to use DMA process
            (+++) Declare a DMA_HandleTypeDef handle structure for the transmit or receive Stream/Channel
            (+++) Enable the DMAx clock
            (+++) Configure the DMA handle parameters
            (+++) Configure the DMA Tx or Rx Stream/Channel
            (+++) Associate the initialized hdma_tx handle to the hspi DMA Tx or Rx handle
            (+++) Configure the priority and enable the NVIC for the transfer complete interrupt on the DMA Tx
                  or Rx Stream/Channel

    (#) Program the Mode, BidirectionalMode , Data size, Baudrate Prescaler, NSS
        management, Clock polarity and phase, FirstBit and CRC configuration in the hspi Init structure.

    (#) Initialize the SPI registers by calling the HAL_SPI_Init() API:
        (++) This API configures also the low level Hardware GPIO, CLOCK, CORTEX...etc)
            by calling the customized HAL_SPI_MspInit() API.
   [..]
     Callback registration:

    (#) The compilation flag USE_HAL_SPI_REGISTER_CALLBACKS when set to 1UL
        allows the user to configure dynamically the driver callbacks.
        Use Functions HAL_SPI_RegisterCallback() to register an interrupt callback.

        Function HAL_SPI_RegisterCallback() allows to register following callbacks:
          (+) TxCpltCallback        : SPI Tx Completed callback
          (+) RxCpltCallback        : SPI Rx Completed callback
          (+) TxRxCpltCallback      : SPI TxRx Completed callback
          (+) TxHalfCpltCallback    : SPI Tx Half Completed callback
          (+) RxHalfCpltCallback    : SPI Rx Half Completed callback
          (+) TxRxHalfCpltCallback  : SPI TxRx Half Completed callback
          (+) ErrorCallback         : SPI Error callback
          (+) AbortCpltCallback     : SPI Abort callback
          (+) SuspendCallback       : SPI Suspend callback
          (+) MspInitCallback       : SPI Msp Init callback
          (+) MspDeInitCallback     : SPI Msp DeInit callback
        This function takes as parameters the HAL peripheral handle, the Callback ID
        and a pointer to the user callback function.


    (#) Use function HAL_SPI_UnRegisterCallback to reset a callback to the default
        weak function.
        HAL_SPI_UnRegisterCallback takes as parameters the HAL peripheral handle,
        and the Callback ID.
        This function allows to reset following callbacks:
          (+) TxCpltCallback        : SPI Tx Completed callback
          (+) RxCpltCallback        : SPI Rx Completed callback
          (+) TxRxCpltCallback      : SPI TxRx Completed callback
          (+) TxHalfCpltCallback    : SPI Tx Half Completed callback
          (+) RxHalfCpltCallback    : SPI Rx Half Completed callback
          (+) TxRxHalfCpltCallback  : SPI TxRx Half Completed callback
          (+) ErrorCallback         : SPI Error callback
          (+) AbortCpltCallback     : SPI Abort callback
          (+) SuspendCallback       : SPI Suspend callback
          (+) MspInitCallback       : SPI Msp Init callback
          (+) MspDeInitCallback     : SPI Msp DeInit callback

     By default, after the HAL_SPI_Init() and when the state is HAL_SPI_STATE_RESET
     all callbacks are set to the corresponding weak functions:
     examples HAL_SPI_MasterTxCpltCallback(), HAL_SPI_MasterRxCpltCallback().
     Exception done for MspInit and MspDeInit functions that are
     reset to the legacy weak functions in the HAL_SPI_Init()/ HAL_SPI_DeInit() only when
     these callbacks are null (not registered beforehand).
     If MspInit or MspDeInit are not null, the HAL_SPI_Init()/ HAL_SPI_DeInit()
     keep and use the user MspInit/MspDeInit callbacks (registered beforehand) whatever the state.

     Callbacks can be registered/unregistered in HAL_SPI_STATE_READY state only.
     Exception done MspInit/MspDeInit functions that can be registered/unregistered
     in HAL_SPI_STATE_READY or HAL_SPI_STATE_RESET state,
     thus registered (user) MspInit/DeInit callbacks can be used during the Init/DeInit.
     Then, the user first registers the MspInit/MspDeInit user callbacks
     using HAL_SPI_RegisterCallback() before calling HAL_SPI_DeInit()
     or HAL_SPI_Init() function.

     When The compilation define USE_HAL_PPP_REGISTER_CALLBACKS is set to 0 or not defined,
     the callback registering feature is not available and weak callbacks are used.

     SuspendCallback restriction:
         SuspendCallback is called only when MasterReceiverAutoSusp is enabled and
     EOT interrupt is activated. SuspendCallback is used in relation with functions
     HAL_SPI_Transmit_IT, HAL_SPI_Receive_IT and HAL_SPI_TransmitReceive_IT.

  [..]
    Circular mode restriction:
    (+) The DMA circular mode cannot be used when the SPI is configured in these modes:
        (++) Master 2Lines RxOnly
        (++) Master 1Line Rx
    (+) The CRC feature is not managed when the DMA circular mode is enabled
    (+) The functions HAL_SPI_DMAPause()/ HAL_SPI_DMAResume() are not supported. Return always
        HAL_ERROR with ErrorCode set to HAL_SPI_ERROR_NOT_SUPPORTED.
        Those functions are maintained for backward compatibility reasons.
</pre> </div></div><!-- contents -->
</div><!-- doc-content -->
<div id="page-nav" class="page-nav-panel">
<div id="page-nav-resize-handle"></div>
<div id="page-nav-tree">
<div id="page-nav-contents">
</div><!-- page-nav-contents -->
</div><!-- page-nav-tree -->
</div><!-- page-nav -->
</div><!-- container -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a href="dir_60925fc218da8ca7908795bf5f624060.html">Drivers</a></li><li class="navelem"><a href="dir_7baec2ddb99168f99d1052c1aec46b20.html">STM32H7xx_HAL_Driver</a></li><li class="navelem"><a href="dir_64d37a621182a63abe7e18b4de6bd839.html">Src</a></li><li class="navelem"><a href="stm32h7xx__hal__spi_8c.html">stm32h7xx_hal_spi.c</a></li>
    <li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.14.0 </li>
  </ul>
</div>
</body>
</html>
